package com.nbufe.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nbufe.domain.entity.CarbonTrading;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 碳交易表(CarbonTrading)表数据库访问层
 *
 * @author luzhiheng
 * @since 2024-01-25 15:22:34
 */
public interface CarbonTradingMapper extends BaseMapper<CarbonTrading> {

    Double queryQuantityByTypeAndYear(@Param("type") int type, @Param("year") int year);

    Double queryQuantityByGovAndYear(@Param("type") int type, @Param("year") int year);

    /**
     * 查询前7天的碳交易信息
     * @param before7Day
     * @param today
     * @return
     */
    List<CarbonTrading> queryBefore7DayTradeInfo(@Param("begin") String before7Day,@Param("end") String today);

    /**
     * 查询指定年所有碳交易
     * @param year
     * @return
     */
    List<CarbonTrading> queryAllTrade(@Param("year") int year);

}

